package com.example.crawler.controller;

import com.example.crawler.component.ExamComponent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * com.example.crawler.controller
 *
 * @author 白雨浓
 * date: 17-10-27 下午3:05
 * content:
 */
@RestController
public class TestController {

    @Autowired
    ExamComponent component;

    @GetMapping
    public String start() throws InterruptedException {
        new Thread(() -> {
            try {
                component.start();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }).start();
        return "success";
    }

    @GetMapping("/test")
    public String test() {
        return "test";
    }
}
